home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12664 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  13.7 KB

  1. Path: slwol1p62.ozemail.com.au!user
  2. From: jmaling@ozemail.com.au (John Maling)
  3. Newsgroups: comp.sys.mac.programmer.games,comp.lang.c++,comp.lang.c
  4. Subject: The Art of C++ (Humor)
  5. Date: Thu, 21 Mar 1996 06:22:11 +1000
  6. Organization: Zip Nada and Zero, Attorneys at Law
  7. Message-ID: <jmaling-2103960622110001@slwol1p62.ozemail.com.au>
  8. NNTP-Posting-Host: slwol1p62.ozemail.com.au
  9. X-Newsreader: Value-Added NewsWatcher 2.0b24.0+
  10.  
  11. The Art of OOP&D (in C++)
  12. (in a big company, team programming environment)
  13. by John Maling
  14.  
  15. PART I (If this is favourably received there will be additional parts,
  16. otherwise this is it.)
  17.  
  18. as inspired by...
  19. SUN TZU ON THE ART OF WAR as Translated from the Chinese
  20. By LIONEL GILES, M.A. (1910) (in the Public Domain)
  21.  
  22. Let the Project Manager heed my words and be victorious
  23. -------------------------------------------------------
  24. The Art of Object Oriented Design and Programming (OOD&P) is of vital
  25. importance. It is a matter of the life or death of software, a road to
  26. safety or to ruin. Hence it is a subject which can on no account be
  27. neglected. The art of OOD&P, then, is governed by five constant factors,
  28. to be taken into account in one's deliberations, when seeking to determine
  29. the conditions obtaining in the specification.
  30.  
  31. These are: (1) The Moral Law; (2) Heaven; (3) Earth; (4) The Project
  32. Manager; (5) Method and Discipline.
  33.  
  34. The Moral Law causes objects to be in complete accord with their messages,
  35. so they will follow them regardless of their own state, undismayed by any
  36. danger.
  37.  
  38. Heaven signifies programming day and night to meet a deadline, hot and
  39. cold sweats, compile times and seasonal office parties.
  40.  
  41. Earth comprises distance to the coffee machine, java and expresso;
  42. consultancy Vs tenure; public classes and private classes; the chances of
  43. life and death.
  44.  
  45. The Project Manager stands for the virtues of wisdom, sincerely,
  46. benevolence, courage and strictness......err......well...... the last one
  47. anyway.
  48.  
  49. By method and discipline are to be understood the marshalling of the
  50. classes in their proper groupings, the graduations of inheritance among
  51. the classes, the maintenance of pathways by which messages may reach the
  52. classes, and the control of CPU cycle expenditure.
  53.  
  54. These five heads should be familiar to every Project Manger: he who knows
  55. them will be victorious; he who knows them not will fail. Therefore, in
  56. your deliberations, when seeking to determine which Team should be given a
  57. project, let them be made the basis of a comparison, in this wise: 
  58.  
  59. (1) Which of the two Teams is imbued with the Moral law? 
  60. (2) Which of the Teams classes has the most re-useability? 
  61. (3) With whom lie the advantages derived from Heaven and Earth?
  62. (4) On which side is abstraction most rigorously enforced?
  63. (5) Which army of programmers is the more powerful?
  64. (6) On which system are lead programmers and code hacks more highly trained? 
  65. (7) Which Lead Programmer holds the greater constancy both in reward and
  66. punishment?
  67.  
  68. By means of these seven considerations I can forecast victory or defeat.
  69.  
  70. The Project Manager that hearkens to my counsel and acts upon it, will
  71. conquer: let such a one be retained! The Manager that hearkens not to my
  72. counsel nor acts upon it, will suffer defeat: let such a one be dismissed!
  73.  
  74. Let now the Lowly Hack hear my words and gain wisdom by them
  75. ------------------------------------------------------------
  76. Heed the profit of my counsel, oh Hack!, avail yourself also of any
  77. helpful circumstances over and beyond the ordinary rules, like paid
  78. lunches.
  79.  
  80. According as circumstances are favourable, one should modify one's control
  81. models.
  82.  
  83. All programming is based on planning, and the deception of both the Lead
  84. Programmer and Project Manager.
  85.  
  86. Hence, when able to program, we must seem unable; when using our classes,
  87. we must seem inactive; when we are near to a solution, we must make them
  88. believe we are far away; when far away, we must make them believe we are
  89. near.
  90.  
  91. Hold out baits to entice the Marketing Department. Feign disorder, and
  92. crush them with the news the product has not made Beta.
  93.  
  94. If the Project Manager is a programmer, be prepared for him. If he is a
  95. GOOD programmer, evade him.
  96.  
  97. If the Lead Programmer is of choleric temper, seek to irritate him with
  98. complex Boochian design notations. Pretend to be witless, that he may grow
  99. arrogant. Then take the real designs to the Project Manager and complain
  100. about your superior, that you may win his position.
  101.  
  102. If he is taking his lunch break, give him no rest. If he is in a briefing
  103. with the Manager, interrupt them.
  104.  
  105. Attack him where he is unprepared, appear where you are not expected
  106. (confront him in the toilet with your 'breakthrough' state transition
  107. diagram)
  108.  
  109. These programming devices, leading to victory, must not be divulged beforehand.
  110.  
  111. Now the hack who writes great software makes many calculations in his
  112. temple ere the program is written. The hack who writes buggy software
  113. makes but few calculations beforehand. Thus do many calculations lead to
  114. victory, and few calculations to defeat: how much more no calculation at
  115. all! It is by attention to this point that I can foresee who is likely to
  116. be able to debug their code.
  117.  
  118. Thus we may know that there are five essentials for victory: (1) He will
  119. win who knows when to code and when not to code. (2) He will win who knows
  120. how to handle both the Method and the Message. (3) He will win whose
  121. design is consistent. (4) He will win who, prepared himself, waits to take
  122. the Lead Programmer and Project Manager unprepared. (5) He will win who
  123. has CPU capacity and is not interfered with by Upper Management.
  124.  
  125. Hence the saying: If you know the code and know yourself, you need not
  126. fear to write a hundred programs. If you know yourself but not the code,
  127. for every great program you will also write a pile of crap. If you know
  128. neither the code nor yourself, you will soon be out of a job....
  129.  
  130. Let the Finance Department hear my words that they may better profit
  131. ---------------------------------------------------------------------
  132. John Maling said: In the operations of programming, where there are in the
  133. field a thousand derived classes, as many bloated functions, and a hundred
  134. thousand mail-clad data structures, with message demands enough to absorb
  135. a thousand CPU cycles, the expenditure on the mainframe and at the
  136. terminal, including entertainment of guests, small items such as glue and
  137. paint, and sums spent on chariots and armour, will reach the total of a
  138. thousand ounces of silver per day. Such is the cost of writing a program
  139. exceeding 1,000,000 lines of code.
  140.  
  141. When a team engages in programming, if completion of the project is long
  142. in coming, their wits will grow dull and their ardour will be damped. If
  143. they must lay siege to old source code, they will exhaust their strength. 
  144.  
  145. Again, if code maintenance is protracted, the resources of the Company
  146. Programmers will not be equal to the strain.
  147.  
  148. Now, when their wits are dulled, their ardour damped, their strength
  149. exhausted and your treasure spent, external contract programmers will
  150. spring up to take advantage of your extremity. Then no man, however wise,
  151. will be able to avert the consequences that must ensue.
  152.  
  153. Thus, though we have heard of stupid haste in bringing products to market,
  154. cleverness has never been seen associated with long delays.
  155.  
  156. There is no instance of a company having profited from vaporware (at least
  157. in no way the Finance Department can calculate!)
  158.  
  159. Poverty of the local branch office causes a team of hacks to be maintained
  160. by contributions from head office. Contributing to maintain a team at a
  161. distance causes the company to be impoverished because of their long lunch
  162. breaks.
  163.  
  164. Let the Lead Programmer heed my words and be enriched!
  165. ------------------------------------------------------
  166. It is only one who is thoroughly acquainted with the evils of structured
  167. programming that can thoroughly understand the profitable path of OOD&P.
  168.  
  169. The skilful programmer does not duplicate class functionality, neither are
  170. his messages dispatched more than once.
  171.  
  172. Bring classes with you from your own library, but forage on existing
  173. classes. Thus the design will have classes enough for its needs.
  174.  
  175. On the other hand, the demands of creating new classes and reworking the
  176. dynamic model cause anguish to increase; and anguish causes the
  177. programmers substance to be drained away.
  178.  
  179. When a programmers substance is drained away, he will be afflicted by
  180. heavy exactions.
  181.  
  182. With this loss of substance and exhaustion of strength, the offices of the
  183. programmers will be stripped bare, and three-tenths of their income will
  184. be dissipated; while the departments expenses for broken chariots,
  185. worn-out horses, breast-plates and helmets, bows and arrows, spears and
  186. shields, protective mantles, draught-oxen and heavy wagons, will amount to
  187. four-tenths of its total revenue.
  188.  
  189. Then will the Demons of Finance grow restless, and earthquakes shake your abode.
  190.  
  191. As a torch can be spent, so can your programmers, pity the Team Leader
  192. whose programmers burn out in a cave!
  193.  
  194. The acrid scent of burning hacks is an invocation to the Gods of Upper
  195. Management, the Overseers whose visages are rarely seen save at times of
  196. calamity or change.
  197.  
  198. The sane man in no wise invites Their attention.
  199.  
  200. Hence a wise Leader makes a point of foraging on existing classes. One
  201. cartload of another's classes is equivalent to twenty of one's own, and
  202. likewise a single object of his provender is equivalent to twenty from
  203. one's own store.
  204.  
  205. Now in order to re-use classes, our programmers must be roused to anger;
  206. and that there may be advantage for finding them, they must have their
  207. rewards.
  208.  
  209. Therefore in searching for class re-use, when ten or more classes have
  210. been found, those should be rewarded who found the first. Our own messages
  211. should be substituted for those of the original code, and the objects
  212. mingled and used in conjunction with ours. The captured classes should be
  213. kindly treated and kept.
  214.  
  215. This is called, re-using classes to augment one's own program.
  216.  
  217. In all programming, then, let your great task be completion, not lengthy
  218. feature lists.
  219.  
  220. Thus it may be known that the Lead Programmer is the arbiter of the
  221. projects fate, and the manager on whom it depends whether the project
  222. shall be in peace or in peril.
  223.  
  224. John Maling said: In the practical art of Object Oriented Design and
  225. Programming the best thing of all is to take the enemy's program whole and
  226. intact; to modify it is not so good. So, too, it is better to reuse a
  227. whole class group than to separate it, to capture an abstract class, a
  228. superclass or a derived class entire than to destroy them.
  229.  
  230. Hence to hack your way into another's code is not supreme excellence;
  231. supreme excellence consists in entering the enemy's code without breaking
  232. it in the process. This is the Greatest Purpose of OOD&P.
  233.  
  234. Thus the highest form of C++ is to use only the enemy's interfaces; the
  235. next best is to use his class groups; the next in order is to isolate his
  236. classes; and the worst policy of all is to besiege a mountain of source
  237. code.
  238.  
  239. The rule is not to besiege source code if it can possibly be avoided. The
  240. preparation of mantlets, movable shelters, and various implements of war,
  241. will take up three whole months; and the drinking of coffee over endless
  242. printouts will take three months more.
  243.  
  244. Yet, before a mountain of printout the greatness of OOD manifests itself,
  245. while the Structured Programmer is cast down in confusion.
  246.  
  247. The foolish C Team Leader, unable to control his irritation, will launch
  248. his programmers to the assault like swarming ants, with the result that
  249. one-third of them are slain, while the code still remains
  250. incomprehensible. Such are the disastrous effects of C.
  251.  
  252. The skilful C++ Team Leader subdues the enemies code without any fighting;
  253. he captures their classes without laying siege to them; he uses their
  254. functionality without lengthy operations inside the class methods. With
  255. his forces intact he will dispute the mastery of the Project, and thus,
  256. without losing a single hack, his triumph will be complete. This is the
  257. method of attacking programming through OOD&P.
  258.  
  259. Let Senior Management now profit from my counsel
  260. ------------------------------------------------
  261. It is the rule in Company battle, if our assets are ten to the enemy's
  262. one, to purchase him; if five to one, to attack him in the marketplace; if
  263. twice as numerous, to split off a new company.
  264.  
  265. If equally matched, we can offer battle; if slightly inferior in size, we
  266. can avoid his best selling products; if quite unequal in every way, we can
  267. flee from him into niche markets.
  268.  
  269. Though an obstinate fight may be made by a small company, in the end it
  270. must be captured by the larger company.
  271.  
  272. Now Upper Management is the bulwark of the Company; if the bulwark is
  273. complete at all points; the Company will be strong; if the bulwark is
  274. defective, the Company will be weak.
  275.  
  276. There are three ways in which Senior Management can bring misfortune upon
  277. its programmers: 
  278.  
  279. (1) By commanding the hacks to write an application before conceiving the
  280. Dynamic Model, being ignorant of the fact that they cannot obey. This is
  281. called hobbling the programmers.
  282.  
  283. (2) By attempting to govern hacks in the same way as they administer
  284. Marketing, being ignorant of the conditions which obtain amongst the
  285. hacks. This causes restlessness in the programmers minds.
  286.  
  287. (3) By employing Project Managers without discrimination, through
  288. ignorance of the Hacks principle of Creative Anarchy. This shakes the
  289. confidence of the programmers.
  290.  
  291. And when the programmers are restless and distrustful, trouble is sure to
  292. come from other software companies. This is simply bringing anarchy into
  293. the Company, and flinging victory away.
  294.  
  295. END Part I
  296. ----------
  297. This lot was conceived out of a dreamy mix of four hours per day of train
  298. travel, during which time I read 'The Art of War' by Sun Tzu and
  299. 'Designing Object-Oriented C++ Applications Using the Booch Method' by
  300. Robert C. Martin.
  301.  
  302. After three days without programming life becomes meaningless. <unknown>
  303.